//
//  UIFont+XMExtension.swift
//  AnneKit-Swift
//
//  Created by 寜小陌 on 2021/3/3.
//  Copyright © 2021 宁小陌. All rights reserved.
//

import Foundation
import UIKit

/**
    苹方-简 中黑体    PingFangSC-Medium
    苹方-简 中粗体    PingFangSC-Semibold
    苹方-简 细体      PingFangSC-Light
    苹方-简 极细体    PingFangSC-Ultralight
    苹方-简 常规体    PingFangSC-Regular
    苹方-简 纤细体    PingFangSC-Thin
*/
extension UIFont {
    
    /*! 自定义字体 */
    func customFont(_ size: CGFloat, name: String!) -> UIFont {
        return UIFont(name: name, size: size)!
    }
    
    class func defaultFont(size: CGFloat) -> UIFont {
        return UIFont.systemFont(ofSize: size)
    }
    
    class func boldFont(size: CGFloat) -> UIFont {
        return UIFont.boldSystemFont(ofSize: size)
    }
    
    class func kFontSizeRegular(size: CGFloat) -> UIFont {
        return UIFont(name: "PingFangSC-Regular", size: size)!
    }
    
    class func kFontSizeMedium(size: CGFloat) -> UIFont {
        return UIFont(name: "PingFangSC-Medium", size: size)!
    }
    
    class func kFontSizeBold(size: CGFloat) -> UIFont {
        return UIFont(name: "PingFangSC-Semibold", size: size)!
    }
    
    class func kFontSizeArialBoldMT(size: CGFloat) -> UIFont {
        return UIFont(name: "Arial-BoldMT", size: size)!
    }
    
}
